%% (* ::Package:: *)
clear all

%% These files contain AP3's core data such as SR matrices
load '../../raw/modified-ap3/2011_PM_Worksheet_Area_Low_Western_Adj'
load '../../raw/modified-ap3/2011_PM_Worksheet_Med_Tall_Western_Adj'

%% Change Emission files depending on NEI year
Area_Source{4,1}=csvread('../../raw/modified-ap3/area_sources_2014.csv');
Low_Stack{4,1}=csvread('../../data/modified-ap3/low_1997.csv');
Med_Stack{4,1}=csvread('../../raw/modified-ap3/medium_2014.csv');
Tall_Stack{4,1}=csvread('../../raw/modified-ap3/tall_2014.csv');
New_Tall{4,1}=csvread('../../raw/modified-ap3/tall2_2014.csv');

%% Change Population and Mortality for all years
Mortality{6,1}=csvread('../../data/modified-ap3/pop_1997_prime_aged.csv');
Mortality{3,1}=csvread('../../data/modified-ap3/mort_1997.csv');

%% Set Parameters for VRMR, DR-Functions
% WTP_Mort = 9186210;
% 2020 dollars. 
WTP_Mort = 9626754.41; 
DoseResponseAdult= 0.005826891; % Krewski
DoseResponseInfant=0.006765865; % Woodruff 2006

%% Set Calibration Parameters according to attached .pdf document
NH4_Cal_base=0.31;
NOx_Cal_base=0.58;
PM25_Cal_base=.66;
SO2_Cal_base=1.33;
VOC_Cal_base=.03;
B_VOC_Cal=.028;

%% Reminder: Also change csv output files to write in AP3_Outputs.m file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SO2 = zeros (3109,5);
NOx = zeros (3109,5);
NO3 = zeros (3109,1);
PM_25_Primary = zeros (3109,5);
NH3 = zeros (3109,5);
NH4 = zeros (3109,1);
NH4e = zeros (3109,1);
SO4 = zeros (3109,1);
A_VOC = zeros (3109,5);
B_VOC = zeros (3109,1);

PM_25_A = zeros (3109,1);
PM_25_Dust = zeros(3109,1);
PM_25_L = zeros (3109,1);
PM_25_M = zeros (3109,1);
PM_25_T = zeros (565,1);
PM_25_T2 = zeros (91,1);
NOx_A = zeros (3109,1);
NOx_L = zeros (3109,1);
NOx_M = zeros (3109,1);
NOx_T = zeros (565,1);
NOx_T2 = zeros (91,1);
SO2_A = zeros (3109,1);
SO2_L = zeros (3109,1);
SO2_M = zeros (3109,1);
SO2_T = zeros (565,1);
SO2_T2 = zeros (91,1);
NH3_A = zeros (3109,1);
NH3_L = zeros (3109,1);
NH3_M = zeros (3109,1);
NH3_T = zeros (565,1);
NH3_T2 = zeros (91,1);
VOC_A = zeros (3109,1);
VOC_L = zeros (3109,1);
VOC_M = zeros (3109,1);
VOC_T = zeros (565,1);
VOC_T2 = zeros (91,1);
PM_25_B = zeros (3109,1);

All_Mort = cell(4,1);

Model_Morbidity =0;

%% Number of Sources
S = 3109;
T = 565;
T2 = 91;